Optimal. Leaf size=116 \[ -\frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {2 a^2 \cot (c+d x)}{d}+\frac {9 a^2 \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}+\frac {a^2 \cot (c+d x) \csc (c+d x)}{8 d}+2 a^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.18, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2872, 3770, 3767, 8, 3768, 2638} \[ -\frac {a^2 \cos (c+d x)}{d}-\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {2 a^2 \cot (c+d x)}{d}+\frac {9 a^2 \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}+\frac {a^2 \cot (c+d x) \csc (c+d x)}{8 d}+2 a^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2638
Rule 2872
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \cot ^4(c+d x) \csc (c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac {\int \left (2 a^6-a^6 \csc (c+d x)-4 a^6 \csc ^2(c+d x)-a^6 \csc ^3(c+d x)+2 a^6 \csc ^4(c+d x)+a^6 \csc ^5(c+d x)+a^6 \sin (c+d x)\right ) \, dx}{a^4}\\ &=2 a^2 x-a^2 \int \csc (c+d x) \, dx-a^2 \int \csc ^3(c+d x) \, dx+a^2 \int \csc ^5(c+d x) \, dx+a^2 \int \sin (c+d x) \, dx+\left (2 a^2\right ) \int \csc ^4(c+d x) \, dx-\left (4 a^2\right ) \int \csc ^2(c+d x) \, dx\\ &=2 a^2 x+\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^2 \cos (c+d x)}{d}+\frac {a^2 \cot (c+d x) \csc (c+d x)}{2 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {1}{2} a^2 \int \csc (c+d x) \, dx+\frac {1}{4} \left (3 a^2\right ) \int \csc ^3(c+d x) \, dx-\frac {\left (2 a^2\right ) \operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{d}+\frac {\left (4 a^2\right ) \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}\\ &=2 a^2 x+\frac {3 a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {a^2 \cos (c+d x)}{d}+\frac {2 a^2 \cot (c+d x)}{d}-\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}+\frac {1}{8} \left (3 a^2\right ) \int \csc (c+d x) \, dx\\ &=2 a^2 x+\frac {9 a^2 \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a^2 \cos (c+d x)}{d}+\frac {2 a^2 \cot (c+d x)}{d}-\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.23, size = 215, normalized size = 1.85 \[ -\frac {a^2 \sin (c+d x) (\sin (c+d x)+1)^2 \left (192 \cot (c+d x)+\csc ^4\left (\frac {1}{2} (c+d x)\right ) (3 \csc (c+d x)+8)-2 \csc ^2\left (\frac {1}{2} (c+d x)\right ) (3 \csc (c+d x)+64)+8 (8 \cos (c+d x)+7) \sec ^4\left (\frac {1}{2} (c+d x)\right )-48 \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^5(c+d x)+24 \sin ^2\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)-24 \csc (c+d x) \left (16 (c+d x)-9 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+9 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )\right )}{192 d \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.53, size = 219, normalized size = 1.89 \[ \frac {96 \, a^{2} d x \cos \left (d x + c\right )^{4} - 48 \, a^{2} \cos \left (d x + c\right )^{5} - 192 \, a^{2} d x \cos \left (d x + c\right )^{2} + 90 \, a^{2} \cos \left (d x + c\right )^{3} + 96 \, a^{2} d x - 54 \, a^{2} \cos \left (d x + c\right ) + 27 \, {\left (a^{2} \cos \left (d x + c\right )^{4} - 2 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 27 \, {\left (a^{2} \cos \left (d x + c\right )^{4} - 2 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 32 \, {\left (4 \, a^{2} \cos \left (d x + c\right )^{3} - 3 \, a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.28, size = 162, normalized size = 1.40 \[ \frac {3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 16 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 384 \, {\left (d x + c\right )} a^{2} - 216 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 240 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {384 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + \frac {450 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 240 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.33, size = 149, normalized size = 1.28 \[ -\frac {3 a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{8 d \sin \left (d x +c \right )^{2}}-\frac {3 a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{8 d}-\frac {9 a^{2} \cos \left (d x +c \right )}{8 d}-\frac {9 a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8 d}-\frac {2 a^{2} \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}+\frac {2 a^{2} \cot \left (d x +c \right )}{d}+2 a^{2} x +\frac {2 a^{2} c}{d}-\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{4 d \sin \left (d x +c \right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.43, size = 167, normalized size = 1.44 \[ \frac {32 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a^{2} - 3 \, a^{2} {\left (\frac {2 \, {\left (5 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + 12 \, a^{2} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} - 4 \, \cos \left (d x + c\right ) + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.77, size = 265, normalized size = 2.28 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {9\,a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,d}-\frac {4\,a^2\,\mathrm {atan}\left (\frac {16\,a^4}{9\,a^4+16\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}-\frac {9\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{9\,a^4+16\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {5\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,d}-\frac {-20\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+32\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-\frac {56\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4}+\frac {4\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}+\frac {a^2}{4}}{d\,\left (16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________